﻿using System.Collections;
using System.Collections.Generic;

namespace ExcelToData
{
    public abstract class BaseSinglton<T> where T : new()
    {
        private static T singleton;
        private static readonly object singletonLock = new object();

        public static T Singleton
        {
            get
            {
                if (singleton == null)
                {
                    lock (singletonLock)
                    {
                        if (singleton == null)
                        {
                            singleton = new T();
                        }
                    }
                }
                return singleton;
            }
        }
        public static bool IsSingtonExist { get { return singleton != null; } }
    }
}


